/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.wpi.first.wpilibj.templates.commands;

import edu.wpi.first.wpilibj.templates.assets.shooterstates.ZingStateMachine;
import edu.wpi.first.wpilibj.templates.assets.statemachine.State;

/**
 *
 * @author Jarrod Risley
 */
public class ChangeIndexerState extends CommandBase {
    
    /*
     * Global Class Variables
     */
    private State commandedState;
    
    public ChangeIndexerState(State state) {
        // Use requires() here to declare subsystem dependencies
        // eg. requires(chassis);
        
        requires(intake);
        requires(shooter);
        commandedState = state;
        
    } // end ChangeIndexerState Constructor

    // Called just before this Command runs the first time
    protected void initialize() {
        
        ZingStateMachine.indexerState.setState(commandedState);
        
    } // end intialize

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
        
    } // end execute

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
        return commandedState.getFinished();
    } // end isFinished

    // Called once after isFinished returns true
    protected void end() {
    } // end end...lolz

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
    } // end interrupted
    
} // end ChangeIndexerState
